package com.jprocms.module.cms.es.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Map;

/**
 * @author jprocms
 */

@Data
@Schema(description = "内容es检索功能查询dto")
public class FrontSearchDto {

    @Schema(description = "搜索关键词，多个以,隔开")
    private String q;
    @Schema(description = "搜索关键词匹配规则，1:匹配任意关键词 2：匹配所有关键词 3：所有关键词都不匹配 默认 1")
    private Integer qMatchType = 1;
    @Schema(description = "搜索关键词匹配项，1:标题匹配 2：内容文本匹配 3：标题匹配或者内容文本匹配 默认 3")
    private Integer qMathPos = 3;
    @Schema(description = "站点id")
    private Long siteId;
    @Schema(description = "栏目id，多个以,隔开")
    private String channelIdStrs;
    @Schema(description = "栏目路径集合，多个以,隔开")
    private String channelPaths;
    @Schema(description = "标记属性集合,多个以,隔开")
    private String dictMarkStrs;
    @Schema(description = "区块ID集合,多个以,隔开")
    private String dictBlockStrs;
    @Schema(description = "发布时间查询范围 1：当天内 2：当周内：3：当月内 4：当年内 5：指定发布时间范围")
    private Integer timeStage = 5;
    @Schema(description = "内容发布时间(开始)")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date releaseTimeStart;
    @Schema(description = "内容发布时间(结束)")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date releaseTimeEnd;
    @Schema(description = "是否置顶")
    private Boolean isTop;
    @Schema(description = "排序规则 0:默认排序（置顶在前，再按发布时间降序）,1:按照发布时间降序,2:按照发布时间升序,3:按照创建时间降序,4:按照创建时间升序,5:总访问量降序,6:总访问量升序,7:总访问量升序,8:总评论量降序,9:总评论量升序,10:总点赞量降序,11:总点赞量升序,12:总点踩数量降序,13:总点踩数升序,14:总下载量降序,15:总下载量升序")
    private Integer orderBy;
    @Schema(description = "分页页数")
    private Long pageNo = 1L;
    @Schema(description = "分页页大小")
    private Long pageSize = 20L;
    @Schema(description = "搜索起始位置")
    private Integer offset;

    @Schema(description = "自定义字段查询")
    private Map<String, Object> customs;


}
